//导入request.js请求工具
import request from '@/utils/request.js'
//产品管理接口·······································································································
export const uploadfileservice = (data,elseid)=>{//上传文件
    return request.post('/uploadProductionFile?elseid='+elseid, data);
}
export const getloadfilenameservice = (data)=>{
    return request.get('/getLoadProductionFileName?elseid='+data);
}
export const loadfileservice = (data)=>{
    return request.get('/downloadfile/'+data);
}
export const addstaffservice = (data) => {  
    return request.post('/addProduction', data);
}
export const updatestaffservice = (data) => {
    return request.put('/updateProduction', data)
}
export const deletestaffservice = (data) => {
    return request.delete('/deleteProduction?id=' + data)
}
export const getAllservice = (data) => {
    return request.post('/getProduction', data);
}
export const getproductionsforpsservice = (data) => {
    return request.get('/getproductionsforps?type='+data);
}
//产品管理接口·······································································································
export const inquiryProductionPSservice = (data) => {
    return request.post('/inquiryProductionPS',data)
}


//价格本管理接口·····································································
export const addProductionPSservice = (data) => {
    return request.post('/addProductionPS', data);
}
export const updateProductionPSservice = (data) => {
    return request.put('/updateProductionPS', data)
}
export const getProductionPSservice = (data)=> {
    return request.post('/getProductionPS', data);
}
//价格本管理接口·····································································



//销售片区管理接口·········································································································
export const addareaservice = (data) => {  
    return request.post('/addArea', data);
}
export const updateareaservice = (data) => {
    return request.put('/updateArea', data)
}
export const deleteareaservice = (data) => {
    return request.delete('/deleteArea?id=' + data)
}
export const getareaservice = (data) => {
    return request.post('/getArea', data);
}
export const getallareaservice = () => {
    return request.get('/getAllArea');
  }
//销售片区管理接口·········································································································

export const getalljobsservice = () => {
    return request.get('/job')
}
export const getpartstaffservice = (data) => {
    return request.post('/listpartmajors', data);
}
//Course的请求接口
export const addcourseservice = (data) => {  //已改-=-=-=-=-========-=-=---=-=-=-=-=-=-=-=-
    return request.post('/addUser', data);
}
export const getpartcourseservice = (data) => {
    return request.post('/getUser', data);
}
export const deletecourseservice = (data) => {
    return request.delete('/deleteUser?id=' + data)
}
export const updatecourseservice = (data) => {
    return request.put('/updateUser', data)
}
export const getpartuserinfoservice = (data) => { //已改
    return request.post('/allusers', data);
}

export const moveservice = (areaid,data)=>{
    return request.post('/moveUser?areaid='+areaid,data,{
        headers: {
            'Content-Type': 'application/json'
        }
    });
}
export const movegetUserservice = (data)=>{
    return request.post('/movegetUser',data)
}


export const deleteselectcourse = (data) => {
    return request.delete('/deleteselectcourse?courseid=' + data);
}
export const addselectcourse = (data) => {
    return request.get('/addselectcourse?courseid=' + data);
}

export const getalluserservice = () => {
    return request.get('/getAllUser');
  }

  
export const getallareamasterservice = (data) => {
    return request.post('/getAllAreaMaster' , data);
  }

  export const getallnotareamasterservice = (data) => {
    return request.post('/getAllNotAreaMaster' , data);
  }

  

  export const getAllAreaMasterNotChooseservice = (data) => {
    return request.post('/getAllAreaMasterNotChoose' , data);
  }
  export const getAllNotAreaMasterNotChooseservice = (data) => {
    return request.post('/getAllNotAreaMasterNotChoose' , data);
  }


export const deletekeymanservice = (id) => {
    return request.delete('/deleteKeyMan?id=' + id);
  }
export const deleteProductionPSservice = (id) => {
    return request.delete('/deleteProductionPS?id='+id)
}
export const getcontractsservice = (data) => {
    return request.get('/getcontractsinclient?str='+data.str+'&clientcompanyid='+data.clientcompanyid)
}
export const deletecontractservice = (id) => {
    return request.delete('/deleteContract?id='+id)
}





















//bookcategory
export const getallbookcategoryservice = () => {
    return request.get('/category/getall');
}

export const addbookcategoryservice = (data) => {
    return request.post('/category/add', data);
}
export const updatauserservice = (data) => {
    return request.put('/updateuser', data);
}
export const deleteuserservice = (data) => {  //已改
    return request.delete('/deleteuser?id=' + data);
}
export const detailbookcategoryservice = (data) => {
    return request.get('/category/detail?id=' + data);
}
//book
export const getallbookservice = () => {
    return request.get('/book/getall');
}
export const getpartpathservice = (data) => {  //已改·························································
    return request.post('/pathlist', data);
}
export const updatepathservice = (data) => { //已改······························································
    return request.put('/pathupdate', data);
}
export const detailbookservice = (data) => {
    return request.get('/book/detail?id=' + data);
}
export const deletepathservice = (data) => {  //已改``````````````````````````````````````````````````````````````
    return request.delete('/pathdelete?id=' + data);
}
export const lendbookservice = (data) => {
    return request.post('/book/lend', data);
}

//pathmincost
export const mincostservice = (data) => {
    console.log(data.startPoint);
    return request.get('/path/selectAllPath?startPoint=' + data.startPoint + '&endPoint=' + data.endPoint);
}
export const mintimeservice = (data) => {
    return request.get('/path/selectAllPathMinTime?startPoint=' + data.startPoint + '&endPoint=' + data.endPoint);
}
export const limittimeservice = (data) => {
    return request.get('/path/selectAllPathLimitTime?startPoint=' + data.startPoint + '&endPoint=' + data.endPoint + '&limitTime=' + data.limitTime);
}


export const addcontractservice = (data) => {
    return request.post('/addContract',data)
}

export const getUserByTypeService = (data) => {
    return request.post('/getUserByType', data);
}
